useState displays previous state when getting value from onChange event

welcome to shbcf.ru